package cn.zebra.dev.product.module.cart.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author runnable@sina.cn
 */
@Getter
@Setter
@TableName("cart")
public class CartEntity {

    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "店铺id", hidden = true)
    private Long shopId;

    @ApiModelProperty(value = "用户id", hidden = true)
    private Long userId;

    @ApiModelProperty("商品id")
    private Long productId;

    @TableField(exist = false)
    @ApiModelProperty("商品名称")
    private String productName;

    @ApiModelProperty("购买时商品属性值 (数组格式:[金色, 16GB])")
    private String productAttributes;

    @ApiModelProperty("商品skuId")
    private Long productSkuId;

    @ApiModelProperty("单价")
    private BigDecimal unitPrice;

    @ApiModelProperty("数量")
    private Long num;

    @ApiModelProperty("总价")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "是否购买/是否下单", hidden = true)
    private Boolean buyFlag;

    @ApiModelProperty(value = "是否删除", hidden = true)
    private Boolean deleteFlag;

    @ApiModelProperty(value = "加入购物车时间", hidden = true)
    private LocalDateTime createTime;
}
